package com.yuanqi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 库存调拨单
 * @TableName ware_transfer
 */
@TableName(value ="ware_transfer")
@Data
public class WareTransfer implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 调拨单号
     */
    @TableField("transfer_code")
    private String transferCode;

    /**
     * 调出仓库ID
     */
    @TableField("from_warehouse_id")
    private Long fromWarehouseId;

    /**
     * 调入仓库ID
     */
    @TableField("to_warehouse_id")
    private Long toWarehouseId;

    /**
     * 调拨类型：内部调拨、外部调拨
     */
    @TableField("transfer_type")
    private String transferType;

    /**
     * 调拨日期
     */
    @TableField("transfer_date")
    private Date transferDate;

    /**
     * 状态：0-新建，1-待审核，2-已审核，3-已完成，4-已驳回
     */
    private Integer status;

    /**
     * 创建人
     */
    @TableField("created_by")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField("created_at")
    private Date createdAt;

    /**
     * 审核人
     */
    @TableField("approved_by")
    private String approvedBy;

    /**
     * 审核时间
     */
    @TableField("approved_at")
    private Date approvedAt;

    /**
     * 完成人
     */
    @TableField("completed_by")
    private String completedBy;

    /**
     * 完成时间
     */
    @TableField("completed_at")
    private Date completedAt;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WareTransfer other = (WareTransfer) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTransferCode() == null ? other.getTransferCode() == null : this.getTransferCode().equals(other.getTransferCode()))
            && (this.getFromWarehouseId() == null ? other.getFromWarehouseId() == null : this.getFromWarehouseId().equals(other.getFromWarehouseId()))
            && (this.getToWarehouseId() == null ? other.getToWarehouseId() == null : this.getToWarehouseId().equals(other.getToWarehouseId()))
            && (this.getTransferType() == null ? other.getTransferType() == null : this.getTransferType().equals(other.getTransferType()))
            && (this.getTransferDate() == null ? other.getTransferDate() == null : this.getTransferDate().equals(other.getTransferDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getApprovedBy() == null ? other.getApprovedBy() == null : this.getApprovedBy().equals(other.getApprovedBy()))
            && (this.getApprovedAt() == null ? other.getApprovedAt() == null : this.getApprovedAt().equals(other.getApprovedAt()))
            && (this.getCompletedBy() == null ? other.getCompletedBy() == null : this.getCompletedBy().equals(other.getCompletedBy()))
            && (this.getCompletedAt() == null ? other.getCompletedAt() == null : this.getCompletedAt().equals(other.getCompletedAt()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTransferCode() == null) ? 0 : getTransferCode().hashCode());
        result = prime * result + ((getFromWarehouseId() == null) ? 0 : getFromWarehouseId().hashCode());
        result = prime * result + ((getToWarehouseId() == null) ? 0 : getToWarehouseId().hashCode());
        result = prime * result + ((getTransferType() == null) ? 0 : getTransferType().hashCode());
        result = prime * result + ((getTransferDate() == null) ? 0 : getTransferDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getApprovedBy() == null) ? 0 : getApprovedBy().hashCode());
        result = prime * result + ((getApprovedAt() == null) ? 0 : getApprovedAt().hashCode());
        result = prime * result + ((getCompletedBy() == null) ? 0 : getCompletedBy().hashCode());
        result = prime * result + ((getCompletedAt() == null) ? 0 : getCompletedAt().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", transferCode=").append(transferCode);
        sb.append(", fromWarehouseId=").append(fromWarehouseId);
        sb.append(", toWarehouseId=").append(toWarehouseId);
        sb.append(", transferType=").append(transferType);
        sb.append(", transferDate=").append(transferDate);
        sb.append(", status=").append(status);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", approvedBy=").append(approvedBy);
        sb.append(", approvedAt=").append(approvedAt);
        sb.append(", completedBy=").append(completedBy);
        sb.append(", completedAt=").append(completedAt);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}